package com.gao.construct;

import com.gao.*;

/**
 * 1.会优先选择尽可能注入Bean数量多的构造函数
 * 2.若选定的构造函数中,某个属性无法装配则报错
 *
 * @author GaoXi
 * @date 2022/2/22 20:13
 */
public class ConstructModeBean {
    private WantBean wantBean;
    private WantBean2 wantBean2;
    private WantBeanNotReg wantBeanNotReg;


    public ConstructModeBean() {
    }

    public ConstructModeBean(WantBean wantBean) {
        this.wantBean = wantBean;
    }

    public void setWantBean2(WantBean2 wantBean2) {
        this.wantBean2 = wantBean2;
    }

    /*   public ConstructModeBean(WantBean wantBean, WantBean2 wantBean2) {
        this.wantBean = wantBean;
        this.wantBean2 = wantBean2;
    }*/

/*    public ConstructModeBean(WantBean wantBean, WantBeanNotReg wantBeanNotReg) {
        this.wantBean = wantBean;
        this.wantBeanNotReg = wantBeanNotReg;
    }*/

    @Override
    public String toString() {
        return "ConstructModeBean{" +
            "wantBean=" + wantBean +
            ", wantBean2=" + wantBean2 +
            ", wantBeanNotReg=" + wantBeanNotReg +
            '}';
    }
}
